/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package semant.second_pass;

import semant.Env;
import symbol.ClassInfo;
import symbol.MethodInfo;
import symbol.Symbol;
import syntaxtree.MainClass;
import syntaxtree.VisitorAdapter;

class MainClassHandler extends VisitorAdapter{

    private Env env;

    private MainClassHandler(Env ev)
    {
        env = ev;
    }

    public static void secondPass(Env e, MainClass mainClass) {
        MainClassHandler h = new MainClassHandler(e);
        mainClass.accept(h);
    }

    @Override
    public void visit(MainClass node) {
       ClassInfo cl = env.classes.get(Symbol.symbol(node.className.s));
       MethodInfo mt = cl.methods.get(Symbol.symbol("Main"));

       StatementHandler.secondPass(env, cl, mt, node.s);

    }



}
